import { ServerConfig, ServerValues } from "../../kds-base-define/src/ServerConfig";
import { kdlog } from "kdweb-core/lib/log";
import { LocalConfig } from "../../kds-base-define/src/LocalConfig";

type LocalConfigType = {
	configName:string

	gameNames:{
		areaID:string,
		gameName:string,
	}[]
}
type RedisConfigType = {
	host:string,
	port:number,
	auth:string,
}
export namespace Config {
	export let localConfig:LocalConfigType = LocalConfig.js
	export let myName = localConfig ? localConfig.configName : "s-dbp"
	export let myConfig = ServerConfig.getConfig(myName)
	export let redisConfig:RedisConfigType = ServerConfig.getValue("redis")
}

if(!ServerValues.logEngine) {
	kdlog.enabled.rpc = false
	kdlog.enabled.rpcRemote = false
	kdlog.enabled.req = false
	kdlog.enabled.ws = false
	kdlog.enabled.db = false
	kdlog.enabled.engine = false
}